using System.Data;
using ET;
namespace DA
{
	public class Enterprise_DAL
	{
	private clsConnect cls = new clsConnect();

	#region Getdata
	public DataTable BindGirdEnterprise(string keywords)
	{
        return cls.Search("sp_tb_Enterprise_Search", "@KeyWords", keywords);
	}
    //public DataTable BindGirdEnterpriseDetail(int id)
    //{
    //}
	#endregion

	#region Insert
	public bool InsertEnterprise(Enterprise_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Enterprise_Alias", data.Enterprise_Alias);
	cls.AddParameter("@Enterprise_Name", data.Enterprise_Name);
	cls.AddParameter("@Enterprise_User_Add", data.Enterprise_User_Add);
	cls.AddParameter("@Enterprise_Date_Add", data.Enterprise_Date_Add);
	cls.AddParameter("@Enterprise_Computer_Add", data.Enterprise_Computer_Add);
	cls.AddParameter("@Enterprise_User_Modify", data.Enterprise_User_Modify);
	cls.AddParameter("@Enterprise_Date_Modify", data.Enterprise_Date_Modify);
	cls.AddParameter("@Enterprise_Computer_Modify", data.Enterprise_Computer_Modify);
    cls.ExecuteNonQuery("sp_tb_Enterprise_Insert");
	return true;
	}
	#endregion

	#region Update
	public bool UpdateEnterprise(Enterprise_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Enterprise_ID", data.Enterprise_ID);
	cls.AddParameter("@Enterprise_Alias", data.Enterprise_Alias);
	cls.AddParameter("@Enterprise_Name", data.Enterprise_Name);
	cls.AddParameter("@Enterprise_User_Add", data.Enterprise_User_Add);
	cls.AddParameter("@Enterprise_Date_Add", data.Enterprise_Date_Add);
	cls.AddParameter("@Enterprise_Computer_Add", data.Enterprise_Computer_Add);
	cls.AddParameter("@Enterprise_User_Modify", data.Enterprise_User_Modify);
	cls.AddParameter("@Enterprise_Date_Modify", data.Enterprise_Date_Modify);
	cls.AddParameter("@Enterprise_Computer_Modify", data.Enterprise_Computer_Modify);
	cls.ExecuteNonQuery("sp_tb_Enterprise_Update");
	return true;
	}
	#endregion

	#region Delete
	public bool DeleteEnterprise(int id)
	{
        cls.Delete("sp_tb_Enterprise_Delete", "@Enterprise_ID", id);
	return true;
	}
	#endregion
	}
}